package com.liseen.resource
{
	import flash.system.ApplicationDomain;
	import flash.utils.Dictionary;
	/**
	 *资源池 
	 * @author Liseen
	 * 
	 */	
	public class ResourcePool
	{
		private static var sources:Dictionary = new Dictionary();
		public function ResourcePool()
		{
		}
		public static function add(_arg1:String, _arg2:*):void
		{
			sources[_arg1] = _arg2;
		}
		
		public static function get(_arg1:String):*
		{
			return (sources[_arg1]);
		}
		
		public static function remove(_arg1:String):*
		{
			var _local2:* = get(_arg1);
			delete sources[_arg1];
			return (_local2);
		}
		
		public static function hasResource(_arg1:String):*
		{
			return (!((sources[_arg1] == null)));
		}
		
		public static function getClass(_arg1:String, _arg2:String):*
		{
			var _local3:ApplicationDomain = sources[_arg1];
			if (((_local3) && (_local3.hasDefinition(_arg2))))
			{
				return (_local3.getDefinition(_arg2));
			};
			return (null);
		}
		
		public static function dispose():void
		{
			sources = null;
		}
	}
}